package br.com.infocruz.seam.crm.ejb.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;

import org.jboss.seam.annotations.Name;

@Name("auditTrail")
@Entity
@Table(name="audit_trail")
public class AuditTrail extends AbstractEntity
{
    /**
	 * 
	 */
	private static final long serialVersionUID = 7827859592576617484L;
	
	// seam-gen attributes (you should probably edit these)
	@Id @GeneratedValue
	@Column(precision = 22, scale = 0)
    private Long id;
	
	@Version
    private Integer version;
    
	@Column(name="class_name")
    private String className;
    
	@Column(name="method_name")
    private String methodName;
    
	@ManyToOne
	@JoinColumn(name="user_account_id")
    private UserAccount userAccount;
    
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="start_date")
    private Date startDate;
    
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="end_date")
    private Date endDate;

    // add additional entity attributes

    // seam-gen attribute getters/setters with annotations (you probably should edit)
    
    public AuditTrail() {
	}

    public AuditTrail(String className, String methodName, Date start, Date end, UserAccount userAccount) {
    	this.className = className;
    	this.methodName = methodName;
    	this.startDate = start;
    	this.endDate = end;
    	this.userAccount = userAccount;
	}

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Integer getVersion() {
        return version;
    }

    private void setVersion(Integer version) {
        this.version = version;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String name) {
        this.className = name;
    }

	public UserAccount getUserAccount() {
		return userAccount;
	}

	public void setUserAccount(UserAccount userAccount) {
		this.userAccount = userAccount;
	}

	public String getMethodName() {
		return methodName;
	}

	public void setMethodName(String operation) {
		this.methodName = operation;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date start) {
		this.startDate = start;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date end) {
		this.endDate = end;
	}


}
